@import "../style/theme-color";

.d-select {
  position: relative;
  width: 100%;
  height: 48px;
  margin: 12px 0 24px 0;
  line-height: 1;
  border: solid @gray;
  border-width: 0 0 1px 1px;
  box-sizing: border-box;

  .d-select-list {
    width: 100%;
    position: absolute;
    left: -1px;
    bottom: -162px;
    z-index: 2;
    border: 1px solid @orange;
    box-sizing: border-box;
    background: #F4F5F6;

    ul {
      padding: 0 12px;
      margin: 8px 12px 8px 0;
      list-style: none;
      height: 138px;
      overflow-y: auto;

      &::-webkit-scrollbar {
        width: 8px; /* 纵向滚动条*/
        height: 8px; /* 横向滚动条 */
        background-color: transparent;
      }

      /*定义滚动条轨道 内阴影*/

      &::-webkit-scrollbar-track {
        -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
        background-color: transparent;
      }

      /*定义滑块 内阴影*/

      &::-webkit-scrollbar-thumb {
        -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
        background-color: #707070;
        border-radius: 8px;
      }

      li {
        padding: 0 10px;
        line-height: 26px;
        font-size: 14px;
        border-radius: 8px;
        margin-bottom: 2px;

        &:hover:not(.disabled), &.active {
          cursor: pointer;
          background: #eaeaea;
        }

        &.disabled {
          opacity: .5;
          cursor: not-allowed;
        }
      }
    }
  }

  &.active {
    border-color: @orange;

    &.filled {
      border-color: @gray;
    }

    .d-select-placeholder {
      padding: 0;
      top: 7px;
      left: 12px;
      line-height: 16px;
      font-size: 12px;
      color: #f08519;
      cursor: default;
      font-weight: bold;
    }
  }

  .d-select-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    padding: 16px 12px 7px;
    font-size: 24px;
    color: @gray;
    cursor: text;
    transition: .3s;
  }

  > input {
    position: absolute;
    left: 0;
    bottom: 3px;
    z-index: 2;
    width: 100%;
    padding: 0 48px 0 12px;
    height: 24px;
    border: none;
    box-sizing: border-box;
    font-size: 18px;
    color: #383838;
    background: transparent;
    outline: none;
    caret-color: #f08519;
    cursor: pointer;

    &:disabled {
      opacity: .5;
      cursor: not-allowed;
    }
  }

  .down-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    position: absolute;
    top: 0;
    right: 0;

    > img {
      width: 48px;
      transition: .5s ease;
    }

    &.open {
      > img {
        transform: rotateX(180deg);
      }
    }
  }

  .fade-enter-active, .fade-leave-active {
    transition: .5s cubic-bezier(.215, .61, .355, 1);
  }

  .fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
    transform: translate3d(0, -4px, 0);
    opacity: 0;
  }
}
